home *** CD-ROM | disk | FTP | other *** search
/ Champak 120 / Vol 120.iso / games / bounce_c.swf / scripts / DefineSprite_268_bombDrop / frame_2 / DoAction.as
Text File  |  2010-11-09  |  574b  |  27 lines

  1. this._rotation = Math.random() * 360;
  2. this.exploded = true;
  3. if(_root.sound_on == true)
  4. {
  5.    trapDiffY = 275 - this._y;
  6.    if(trapDiffY < 0)
  7.    {
  8.       trapDiffY = - trapDiffY;
  9.    }
  10.    trapDiffY /= 10;
  11.    trapDiffX = 200 - this._x;
  12.    if(trapDiffX < 0)
  13.    {
  14.       trapDiffX = - trapDiffX;
  15.    }
  16.    trapDiffX /= 10;
  17.    trapVolume = 100 - trapDiffX - trapDiffY;
  18.    if(trapVolume < 10)
  19.    {
  20.       trapVolume = 10;
  21.    }
  22.    boomSound = new Sound(this);
  23.    boomSound.attachSound("fxExplode");
  24.    boomSound.start(0,1);
  25.    boomSound.setVolume(trapVolume);
  26. }
  27.